package com.disease.api.service.web.dashboard;

import com.disease.api.service.model.ResponseResult;
import com.disease.api.service.model.response.dashboard.DiseaseDepartmentSummaryResponse;
import com.disease.api.service.model.response.dashboard.DiseaseItemByDepartmentResponse;
import com.disease.api.service.model.response.dashboard.DiseaseItemByDoctorResponse;
import com.disease.api.service.model.response.dashboard.DiseaseTypeSummaryResponse;
import com.disease.api.service.service.DashBoardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

@Slf4j
@RestController
@RequestMapping(value = "/disease/v1/api/report")
public class DashBoardController {

    @Autowired
    DashBoardService dashBoardService;

    /**
     * 分类-传染病疾病统计汇总
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/diseaseTypeSummary")
    public ResponseResult diseaseTypeSummary(
            @RequestHeader(value = "Start_date") String start_date,
            @RequestHeader(value = "Start_date") String end_date){
        return dashBoardService.diseaseTypeSummary(start_date,end_date);
    }

    /**
     * 分类-传染病疾病统计汇总
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/diseaseItemByType")
    public ResponseResult diseaseItemByType(
            @RequestHeader("Start_date") String startDate,
            @RequestHeader("End_date") String endDate){
        return dashBoardService.diseaseItemByType(startDate,endDate);
    }

    /**
     * 科室-传染病报告统计汇总
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/diseaseDepartmentSummary")
    public ResponseResult diseaseDepartmentSummary(
            @RequestHeader("Start_date") String startDate,
            @RequestHeader("End_date") String endDate){
        return dashBoardService.diseaseDepartmentSummary(startDate,endDate);
    }

    /**
     * 科室-传染病报告统计明细
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/diseaseItemByDepartment")
    public ResponseResult diseaseItemByDepartment(
            @RequestHeader("Start_date") String startDate,
            @RequestHeader("End_date") String endDate){
        return dashBoardService.diseaseDepartmentSummary(startDate,endDate);
    }

    /**
     * 医生-传染病报告统计明细
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/diseaseItemByDoctor")
    public ResponseResult diseaseItemByDoctor(
            @RequestHeader("Start_date") String startDate,
            @RequestHeader("End_date") String endDate){
        return dashBoardService.diseaseItemByDoctor(startDate,endDate);
    }

}
